package com.edu.zju.scs.panacea.controller.exposure;

import com.edu.zju.scs.panacea.entity.BaseResult;
import com.edu.zju.scs.panacea.entity.exposure.Exposure;
import com.edu.zju.scs.panacea.service.exposure.ExposureService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: Yue Liang
 * @Date: 2019-02-09 03:19
 */
@Controller
@EnableAutoConfiguration
public class ExposureController {

    @Autowired
    private ExposureService exposureService;

    @ResponseBody
    @ApiOperation(value="查询某个计划的投放效果", notes="查询某个计划的投放效果")
    @RequestMapping(value = "/exposure/amount/{id}", method = RequestMethod.GET)
    public BaseResult getExposureAmount(@PathVariable Long id) {
        return exposureService.getExposureAmount(id);
    }

    @ResponseBody
    @ApiOperation(value="查询某个计划的投放效果", notes="查询某个计划的投放效果")
    @RequestMapping(value = "/exposure/comparison/{id}", method = RequestMethod.GET)
    public BaseResult getExposureComparison(@PathVariable Long id) {
        return exposureService.getExposureComparison(id);
    }

}
